﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;

namespace WebPiket3Csv
{
    /// <summary>
    /// Логика взаимодействия для Page2_Editor.xaml
    /// </summary>
    public partial class Page2_Editor : Page
    {
        public Page2_Editor()
        {
            InitializeComponent();
            if (PrjProperty.txtDataPkt == "")
            {
                if (File.Exists(PrjProperty.fileNamePkt))
                    PrjProperty.txtDataPkt = File.ReadAllText(PrjProperty.fileNamePkt);
            }
            if (PrjProperty.txtDataSts == "")
            {
                if (File.Exists(PrjProperty.fileNameSts))
                    PrjProperty.txtDataSts = File.ReadAllText(PrjProperty.fileNameSts);
            }
            txtPiket.Text = PrjProperty.txtDataPkt;
            txtStation.Text = PrjProperty.txtDataSts;
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            PrjProperty.txtDataPkt = txtPiket.Text;
            PrjProperty.txtDataSts = txtStation.Text;
        }
    }
}
